<template>
<div class="over">
    <div class="all">
        <div class="left">
            <div class="left_1">
                <h4 class="product_name">{{productMessage.pname}}</h4>
            </div>
            <div class="left_2">
                <span class="product_time">{{productMessage.preleasetime}}</span>
            </div>
            <div class="left_3">
                <img src="../../assets/product/product_intro.png"/>
                <span class="title_1">产品简介：</span>
                <div class="product_msg">{{productMessage.pmoreinformation}}</div>
                
                <!-- <div class="product_msg">{{product_intro}}</div>
                <div class="product_msg">{{product_intro}}</div> -->
            </div>
            <div class="left_4">
                <img src="../../assets/product/product_adver.png"/>
                <span class="title_1">广告/交互要求：</span>
                <div class="product_msg">{{productMessage.prequirement}}</div>
                <!-- <div class="product_msg">{{product_adver}}</div> -->
            </div>
        </div>

        <div class="right">
            <div class="block">
                <el-carousel trigger="click" height="360px">
                    <el-carousel-item v-for="item in img" :key="item">
                        <img class="imgI" :src="item"/>
                        <!-- <h3 class="small">{{ item }}</h3> -->
                    </el-carousel-item>
                </el-carousel>
            </div>
        </div>

        <div class="bottom">
            <span class="title_1">3D模型:</span>
            <el-button class="button" type="success" plain>下载</el-button>
            <el-button class="button_1" type="success">更多信息</el-button>
            <el-button  @click="dialogForm2Visible = true" class="button2_1" type="warning" >编辑</el-button>
            <el-button class="button2" type="info" >撤下</el-button>
        </div>
        <div class="recommond_all">
            <div class="tuijian">
                <h4>为您推荐</h4>
            </div>
         <div class="recommond">
            <div class="cntentsize">
                    <div class="right_center" >
                    
                        <el-card   class="box-card_ll" >
                            <div   class="vedio" >
                                <img class="vedio_pic" src="../../assets/hello/hello1.jpg"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name"></a><br>
                                <a class="vedio_name">山岳风光</a>
                            </div>
                            <div>
                                <el-card class="type"><a class="type_a">科普</a></el-card>
                                <el-card class="type"><a class="type_a">地面</a></el-card>
                                </div>
                                <div class="name_photo11">
                                    <img class="profile_photo" src="../../assets/headgreen.png"/>
                                    <div class="photo_name"><h5>一句话</h5></div>
                                </div>
                            </div>
                        </el-card>
                        <el-card   class="box-card_ll" >
                            <div   class="vedio" >
                                <img class="vedio_pic" src="../../assets/hello/hello2.jpg"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name"></a><br>
                                <a class="vedio_name">学姐推荐好物</a>
                            </div>
                            <div>
                                <el-card class="type"><a class="type_a">科普</a></el-card>
                                <el-card class="type"><a class="type_a">地面</a></el-card>
                                </div>
                                <div class="name_photo11">
                                    <img class="profile_photo" src="../../assets/headgreen.png"/>
                                    <div class="photo_name"><h5>openHappy</h5></div>
                                </div>
                            </div>
                        </el-card>
                        <el-card   class="box-card_ll" >
                            <div   class="vedio" >
                                <img class="vedio_pic" src="../../assets/hello/hello3.jpg"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name"></a><br>
                                <a class="vedio_name">我的书架，你的心</a>
                            </div>
                            <div>
                                <el-card class="type"><a class="type_a">科普</a></el-card>
                                <el-card class="type"><a class="type_a">地面</a></el-card>
                                </div>
                                <div class="name_photo11">
                                    <img class="profile_photo" src="../../assets/headgreen.png"/>
                                    <div class="photo_name"><h5>蔡蔡!</h5></div>
                                </div>
                            </div>
                        </el-card>
                        <el-card   class="box-card_ll" >
                            <div   class="vedio" >
                                <img class="vedio_pic" src="../../assets/hello/hello4.jpg"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name"></a><br>
                                <a class="vedio_name">读书让普通女孩不再</a>
                            </div>
                            <div>
                                <el-card class="type"><a class="type_a">科普</a></el-card>
                                <el-card class="type"><a class="type_a">地面</a></el-card>
                                </div>
                                <div class="name_photo11">
                                    <img class="profile_photo" src="../../assets/headgreen.png"/>
                                    <div class="photo_name"><h5>cddidi</h5></div>
                                </div>
                            </div>
                        </el-card>
                        <el-card   class="box-card_ll" >
                            <div   class="vedio" >
                                <img class="vedio_pic" src="../../assets/hello/hello5.jpg"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name"></a><br>
                                <a class="vedio_name">大学电子产品推荐</a>
                            </div>
                            <div>
                                <el-card class="type"><a class="type_a">科普</a></el-card>
                                <el-card class="type"><a class="type_a">地面</a></el-card>
                                </div>
                                <div class="name_photo11">
                                    <img class="profile_photo" src="../../assets/headgreen.png"/>
                                    <div class="photo_name"><h5>happyOpen</h5></div>
                                </div>
                            </div>
                        </el-card>
                        </div>
                
                    <a class="gengduo">>>更多</a>
                </div>
         </div>
        </div>
        <div class="TradeCenter">
            <div class="button_group">
                <!-- <div>
                    <button @click="switchItem('交易中心')">1</button>
                    <button @click="switchItem('成交记录')">2</button>
                </div> -->
                 <el-radio-group class="el-radio-group-" fill="#4ABDAC" v-model="radio1">
                    <el-button   @click="switchItem('交易中心')" :class="button_type1" label="交易中心">交易中心</el-button>
                    <el-button  @click="switchItem('成交记录')"  :class="button_type2" label="成交记录">成交记录</el-button>
                </el-radio-group>
                <!-- <el-button class="button_group_button1" type="success" >交易中心</el-button>
                <el-button class="button_group_button2" type="success" plain>成交记录</el-button> -->
                <el-input class="button_group_search"   placeholder="请输入内容" suffix-icon="el-icon-search" v-model="input3"></el-input>
            </div>
            <div id="s1"  style="" class="TradeCenter_item">
                <div class="TradeCenter_item1" v-for="(item,index) in productTradeMessage" :key="index">
                    <div class="test4">
                        <img class="youtube1" src="../../assets/producer_space/youtube_logo.svg"/>
                        <a class="confirm">待确认</a>
                        <el-card class="box-card">
                            <div class="vedio">
                                <img class="vedio_pic" :src="item.video.fengmian"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name">{{item.video.vname}}</a><br>
                                <!-- <a class="vedio_name">构建美好社会</a> -->
                            </div>
                            <el-card class="type"><a class="type_a">科普</a></el-card>
                            <el-card class="type"><a class="type_a">地面</a></el-card>
                            </div>
                            <div class="name_photo">
                                <img class="profile_photo" src="../../assets/producer_space/profile_photo.jpeg"/>
                                <div class="photo_name"><h5>{{item.creater.cname}}</h5></div>
                            </div>
                        </el-card>
                        <div class="message_box">
                            <div class="message_call">
                                <h5>联系方式：{{item.creater.cphone}},{{item.creater.cemail}}</h5>
                            </div>
                            <div class="message_adver">
                                <a>广告位：广告位1</a>
                            </div>
                            <div class="message_adver_type">
                                <a>广告类型：按播放量合作</a>
                            </div>
                            <div class="message_times">
                                <a>播放量：3000次</a>
                            </div>
                            <div class="message_cooperate">
                                <a>合作意向：{{item.cointention}}</a>
                                <div class="none"></div>
                                <div class="none"></div>
                            </div>
                            <div class="message_time">
                                <a>成交时间：{{item.costartdate}} 13:03:09</a>
                            </div>
                            <div class="message_money">
                                <a>投送价格：</a>
                                <h2 >{{item.coprice}}元</h2>
                            </div>
                            <div >
                                <el-button  @click="dialogFormVisible = true;dialogOpen(item.apid,item.coid)" class="message_but" type="warning" >去编辑</el-button>
                               
                            </div>
                        </div>
                    </div>
                </div >
                <!-- <div class="TradeCenter_item2">
                    <el-card class="box-card">
                         <div class="vedio">
                            <img class="vedio_pic" src="../../assets/producer_space/vedio_pic.png"/>
                        </div>
                        <div class="fire">
                            <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                            <span class="fire-degree">197</span>
                            <div  class="time">
                                <span class="time">7s+5s+6s/3:05</span>
                            </div>
                             <div class="all_vedio_name">
                            <a class="vedio_name">帮员工建立同理心</a><br>
                            <a class="vedio_name">构建美好社会</a>
                        </div>
                        <el-card class="type"><a class="type_a">科普</a></el-card>
                        <el-card class="type"><a class="type_a">地面</a></el-card>
                        </div>
                        <div class="name_photo">
                            <img class="profile_photo" src="../../assets/producer_space/profile_photo.jpeg"/>
                            <div class="photo_name"><h5>本少女</h5></div>
                        </div>
                    </el-card>
                    <div class="message_box">
                        <div class="message_call">
                            <h5>联系方式：131xxxxxxxxx,1234567@qq.com</h5>
                        </div>
                        <div class="message_adver">
                            <a>广告位：广告位1</a>
                        </div>
                        <div class="message_adver_type">
                            <a>广告类型：按播放量合作</a>
                        </div>
                        <div class="message_times">
                            <a>播放量：3000次</a>
                        </div>
                        <div class="message_cooperate">
                            <a>合作意向：xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a>
                            <div class="none">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
                            <div class="none">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
                        </div>
                        <div class="message_time">
                            <a>成交时间：2022/1/15 13:03:09</a>
                        </div>
                        <div class="message_money">
                            <a>投送价格：</a>
                            <h2 >30W</h2>
                        </div>
                        <div >
                              <el-button class="message_but2" type="danger">待确认</el-button>
                        </div>
                    </div>

                </div > -->
            </div>
            <div id="s2"  style="display:none;" class="TradeCenter_item" >
                <div class="TradeCenter_item1" v-for="(item,index) in productTradeMessage2" :key="index">
                    <div class="test4">
                        <img class="youtube1" src="../../assets/producer_space/youtube_logo.svg"/>
                        <el-card class="box-card">
                            <div class="vedio">
                                <img class="vedio_pic" :src="item.video.fengmian"/>
                            </div>
                            <div class="fire">
                                <img class="fire_burn" src="../../assets/producer_space/if-fire-burn.png"/>
                                <span class="fire-degree">197</span>
                                <div  class="time">
                                    <span class="time">7s+5s+6s/3:05</span>
                                </div>
                                <div class="all_vedio_name">
                                <a class="vedio_name">{{item.video.vname}}</a><br>
                                <!-- <a class="vedio_name">构建美好社会</a> -->
                            </div>
                            <el-card class="type"><a class="type_a">科普</a></el-card>
                            <el-card class="type"><a class="type_a">地面</a></el-card>
                            </div>
                            <div class="name_photo">
                                <img class="profile_photo" src="../../assets/producer_space/profile_photo.jpeg"/>
                                <div class="photo_name"><h5>{{item.creater.cname}}</h5></div>
                            </div>
                        </el-card>
                        <div class="message_box">
                            <div class="message_call">
                                <h5>联系方式：{{item.creater.cphone}},{{item.creater.cemail}}</h5>
                            </div>
                            <div class="message_adver">
                                <a>广告位：广告位1</a>
                            </div>
                            <div class="message_adver_type">
                                <a>广告类型：按播放量合作</a>
                            </div>
                            <div class="message_times">
                                <a>播放量：3000次</a>
                            </div>
                            <div class="message_cooperate">
                                <a>合作意向：{{item.cointention}}</a>
                                <div class="none">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
                                <div class="none">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
                            </div>
                            <div class="message_time">
                                <a>成交时间：{{item.costartdate}} 13:03:09</a>
                            </div>
                            <div class="message_money">
                                <a>投送价格：</a>
                                <h2 >{{item.coprice}}W</h2>
                            </div>
                            <div >
                                <el-button @click="dialogOpen(item.apid,item.coid)" v-if="item.costate=='进行中'" class="message_but3" type="warning" >进行中</el-button>
                                <el-button v-if="item.costate=='已终止'" class="message_but4" type="success">已终止</el-button>
                                <el-button v-if="item.costate=='已拒绝'" class="message_but5" type="info">已拒绝</el-button>
                            </div>
                        </div>
                    </div>
                </div >
            </div>
        </div>

        <el-dialog width="600px" class="trade_edit" title="交易详情" :visible.sync="dialogFormVisible">
            <el-form class="trade_edit_form">
                <el-form-item class="trade_edit_form_item1" label="广告位" :label-width="formLabelWidth">
                    <a>广告位1</a>
                </el-form-item>
                <el-form-item class="trade_edit_form_item2" label="广告产品" :label-width="formLabelWidth">
                    <a>{{productMessage.pname}}</a>
                </el-form-item>
                <el-form-item class="trade_edit_form_item3" label="广告类型" :label-width="formLabelWidth">
                    按照播放次数
                </el-form-item>
                <el-form-item class="trade_edit_form_item5" label="播放量" :label-width="formLabelWidth">
                    <el-input  v-model="input1" placeholder="请输入播放量"></el-input>
                    <span class="trade_edit_form_item5_1" >次</span>
                </el-form-item>
                <el-form-item class="trade_edit_form_item6" label="合作意向" :label-width="formLabelWidth">
                    <el-input
                        type="textarea"
                        :rows="5"
                        placeholder="请输入合作意向说明"
                        v-model="textarea">
                    </el-input>
                </el-form-item>
                <el-form-item class="trade_edit_form_item7" label="投送价格" :label-width="formLabelWidth">
                    <el-input  v-model="input2" placeholder="请输入价格"></el-input>
                    <a class="trade_edit_form_item7_1">万</a>
                </el-form-item>
            </el-form>
            <div class="trade_edit_form_button">
                <el-button class="trade_edit_form_button1" @click="dialogFormVisible = false;RePostDialog()" type="success">保存</el-button>
                <el-button class="trade_edit_form_button2" type="danger" @click="dialogFormVisible = false;refuse()">取消合作</el-button>
            </div>
        </el-dialog>

         <el-dialog width="600px"  class="trade_edit" title="产品详情" :visible.sync="dialogForm2Visible">
            <el-form class="trade_edit_form">
                <el-form-item class="trade_edit_form2_item1" label="产品名" :label-width="formLabelWidth">
                     <a>{{productMessage.pname}}</a>
                </el-form-item>
                <el-form-item class="trade_edit_form2_item2" label="产品类型" :label-width="formLabelWidth">
                按照播放次数
                </el-form-item>
                <el-form-item class="trade_edit_form2_item3" label="产品简介" :label-width="formLabelWidth">
                    <el-input
                        type="textarea"
                        :rows="2"
                        placeholder="请输入内容"
                        v-model="input5">
                    </el-input>
                </el-form-item>
               <el-form-item class="trade_edit_form2_item3" label="广告/交互要求" :label-width="formLabelWidth">
                    <el-input
                        type="textarea"
                        :rows="2"
                        placeholder="请输入内容"
                        v-model="input6">
                    </el-input>
                </el-form-item>
               <el-form-item class="trade_edit_form2_item3" label="淘宝链接" :label-width="formLabelWidth">
                    <el-input
                        type="textarea"
                        :rows="1"
                        placeholder="请输入内容"
                        v-model="input7">
                    </el-input>
                </el-form-item>
                <el-form-item class="trade_edit_form2_item4" label="封面图" :label-width="formLabelWidth">
                   <el-button class="button" type="success" plain>上传</el-button>
                </el-form-item>
                <el-form-item class="trade_edit_form2_item4" label="宣传图" :label-width="formLabelWidth">
                   <el-button class="button" type="success" plain>上传</el-button>
                </el-form-item>
                <el-form-item class="trade_edit_form2_item4" label="3D模型" :label-width="formLabelWidth">
                   <el-button class="button" type="success" plain>上传</el-button>
                </el-form-item>
            </el-form>
            <div class="trade_edit_form2_button">
                <el-button class="trade_edit_form_button1" @click="dialogForm2Visible = false" type="success">保存</el-button>
                <el-button class="trade_edit_form_button2" type="danger" @click="dialogForm2Visible = false">取消</el-button>
                <div class="place"></div>
            </div>
            
        </el-dialog>

        <div>

        </div>

    </div>

</div>
  
</template>

<script>
export default {
    name:'product',
    data() {
        return {
            product_name:"iPhone13 pro",
            product_time:"2021/12/30 13:30:23",
            product_intro:"··iPhone 13 Pro是苹果公司于北京时间2021年9月15日发布的智能手机。··iPhone 13Pro搭载A15 Bionic芯片，拥有四种配色，支持5G网络。有128G、256G、512G、1T可选，售价为999美元起。",
            product_intro2:"··具有IP68级防水，采用独家超瓷晶面板 [15]  。搭载1200万广角镜头+1200万超广角镜头后置摄像系统，前置为1200万像素摄像头。搭载A15 Bionic芯片，支持5G。",
            product_adver:[ "1.产品交互可以实现自然的安放，提高用户体验","2.产品交互可实现3D立体显示，全方位展现","3.实现与手机屏幕的交互，对模型进行旋转、放大"],
            img:[
                require('../../assets/product/diannao.jpg'),
                require('../../assets/product/diannao2.jpg'),
                require('../../assets/product/diannao.jpg'),
                require('../../assets/product/diannao2.jpg'),
            ],
            button_type1:'button_group_button1_focus',
            button_type2:'button_group_button2',
            dialogFormVisible: false,
            formLabelWidth: '120px',
            dialogForm2Visible:false,
            radio: '1',
            value1: '',
            textarea: '',
            input1:[''],//
            input2:'',//投送价格
            input3:'',//搜索框
            input4:'',//产品名
            input5:'',//产品简介
            input6:'',//广告交互要求
            input7:'',//淘宝链接
            radio1:'交易中心',
            product_type:'',
            productTradeMessage:[],
            productTradeMessage2:[],
            productMessage:{},
            message_But3:'message_but3',
            content:'进行中',
            typeChoose:'warning',
            cardMessage:[],
        }
        },
     methods: {
         push:function(id){
            console.log(id)
            sessionStorage.setItem('vid',JSON.stringify(id))
            this.$router.push({path:'/adver_vedio_detail'})
        },
            switchItem:function(tag){
                var s1 = document.getElementById('s1');
                var s2 = document.getElementById('s2');
                if(tag=="交易中心"){
                     this.button_type1='button_group_button1_focus'
                    this.button_type2='button_group_button2'
                    s1.style.display = '';
                    s2.style.display = 'none';
                }
                else{
                    this.button_type2='button_group_button2_focus'
                    this.button_type1='button_group_button1'
                    s1.style.display = 'none';
                    s2.style.display = '';
                }
            },
             dialogOpen(apid,coid){
            sessionStorage.setItem('apid',apid)
             sessionStorage.setItem('coid',coid)
            if(this.item_button1=='item_button1')
            {
                this.dialogForm2Visible = true
            }
            else
                {this.dialogFormVisible = true}
        },
            //单个产品的交易
            productTrade(){
                    //获取上个界面存储的ID
                    var rams=JSON.parse(sessionStorage.getItem("pid"));
                    // console.log(sessionStorage.getItem("vid"));
                    console.log(rams);
                    console.log(typeof(rams));
                    console.log(rams=="1");
                    console.log(typeof("1"))
                    var rams2=Number(rams);
                    console.log(rams2);
                    // var params1=qs.stringify(sessionStorage.getItem("vid"));
                    // console.log(params1);
                    this.$axios({
                    method:'post',
                    url:'http://1.117.65.58:9001/cooperation1/findallbypidjiaoyizhongxin',
                    params:{"pid":rams2},
                    //    headers: {'Content-Type': 'application/json; charset=utf-8'},
                    }).then(response=>{
                    console.log(response);
                    const arr =response.data.data;
                    this.productTradeMessage=arr;
                    console.log(123)
                    console.log(this.productTradeMessage)
                    // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
                }).catch(function(err){
                    console.log(err)
                })
            },

             productTrade2(){
                    //获取上个界面存储的ID
                    var rams=JSON.parse(sessionStorage.getItem("pid"));
                    // console.log(sessionStorage.getItem("vid"));
                    console.log(rams);
                    console.log(typeof(rams));
                    console.log(rams=="1");
                    console.log(typeof("1"))
                    var rams2=Number(rams);
                    console.log(rams2);
                    // var params1=qs.stringify(sessionStorage.getItem("vid"));
                    // console.log(params1);
                    this.$axios({
                    method:'post',
                    url:'http://1.117.65.58:9001/cooperation1/findallbypidjiaoyijilu',
                    params:{"pid":rams2},
                    //    headers: {'Content-Type': 'application/json; charset=utf-8'},
                    }).then(response=>{
                    console.log(response);
                    const arr =response.data.data;
                    this.productTradeMessage2=arr;
                    console.log(444)
                    console.log(this.productTradeMessage2)
                    // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
                }).catch(function(err){
                    console.log(err)
                })
            },

            //单个产品的信息

             productGetMessage(){
                    //获取上个界面存储的ID
                    var rams=JSON.parse(sessionStorage.getItem("pid"));
                    // console.log(sessionStorage.getItem("vid"));
                    console.log(rams);
                    console.log(typeof(rams));
                    console.log(rams=="1");
                    console.log(typeof("1"))
                    var rams2=Number(rams);
                    console.log(rams2);
                    // var params1=qs.stringify(sessionStorage.getItem("vid"));
                    // console.log(params1);
                    this.$axios({
                    method:'post',
                    url:'http://1.117.65.58:9001/product/findbypid',
                    params:{"pid":rams2},
                    //    headers: {'Content-Type': 'application/json; charset=utf-8'},
                    }).then(response=>{
                    console.log(response);
                    const arr =response.data.data;
                    this.productMessage=arr;
                    console.log(777)
                    console.log(this.productMessage)
                    // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
                }).catch(function(err){
                    console.log(err)
                })
            },

             //修改合作订单并post
        RePostDialog(){
             //获取上个界面存储的ID
            var params=JSON.parse(sessionStorage.getItem("apid"));
            var params2=JSON.parse(sessionStorage.getItem("coid"));
            console.log(params);
            params=parseInt(params);
            params2=parseInt(params2);
            var coprice=parseInt(this.input2);
            var coplaybackvolume=parseInt(this.input1[params]);
            var params1={
                    "coid": params2,
                    "coprice":coprice,
                    "coplaybackvolume":coplaybackvolume,
                    "cointention":this.textarea,
                    "productname":this.productMessage.pname,
                    "apid":params,
            };
            // params1=JSON.parse(params1)
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/cooperation/edit',
               data:params1,
            }).then(response=>{
            console.log(response);
            this. productTrade();
            this. productTrade2();
            this.$message({
                title: '成功',
                message: '修改合作成功',
                type: 'success',
                offset:75
            });
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        },
        successrefuse(){
            //获取上个界面存储的ID
            var params=JSON.parse(sessionStorage.getItem("apid"));
            var params2=JSON.parse(sessionStorage.getItem("coid"));
            console.log(params);
            params=parseInt(params);
            params2=parseInt(params2);
            var params1={
                "coid": params2,
            };
            // params1=JSON.parse(params1)
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/cooperation/delete',
               params:params1,
            }).then(response=>{
            console.log(response);
            this. productTrade();
            this. productTrade2();
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        },
        refuse() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
         this.successrefuse(),
          this.$message({
            type: 'success',
            message: '删除成功!',
            offset:75,
           
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除',
            offset:75,
          });          
        });
      },
 showCardMessage(){
        //cardMessage接口开始
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/videoandcreater/findall',
            //    params:params,
            }).then(response=>{
            console.log(response);
            const arr =response.data.data;
            this.cardMessage=arr;
            console.log(this.cardMessage)
            console.log(arr);
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        //cardMessage接口结束
        }
    
    },
    mounted(){
        this.productTrade();
        this.productTrade2();
        this. productGetMessage();
        this.showCardMessage();
    }

}
</script>


<style scoped>
@import "../../style/product.css";
@import "../../style/adver_product.css";
</style>
